import { getQueryParams } from '@/utils';
import http from './http';

export default {
  /**
   * 安排配送
   * @param {String} orderId 订单号
   */
  deliveryOrder(orderId) {
    return http.post('/mall/web/order/v1/deliver', orderId).exec();
  },

  /**
   * @description: 修改订单信息
   * @param {type}
   * @return:
   */
  modifyOrder(data) {
    return http.post(`/mall/web/order/v1/modify`, data).exec();
  },

  /**
   * @description: 获取订单列表
   * @param {type}
   * @return:
   */
  getOrderList(data) {
    return http.get(`/mall/web/order/v1/orders`, data).exec();
  },

  /**
   * 订单退款、退货确认
   * @param {String} orderId 订单号
   */
  confirmRefund(orderId) {
    return http.post('/mall/web/order/v1/refund/confirm', orderId).exec();
  },

  /**
   * 已知晓提醒
   * @param {String} orderId 订单号
   */
  confirmRemind(orderId) {
    return http.post('/mall/web/order/v1/remind/finish', orderId).exec();
  },

  /**
   * 设置已自取
   * @param {String} orderId 订单号
   */
  goodsTaked(orderId) {
    return http.post('/mall/web/order/v1/takeself', orderId).exec();
  },

  // 快递信息
  getExpressInfo(params) {
    return http.get(`/mall/public/v1/express/query`, params).exec();
  },
};
